package com.cykj.v_m_sprintboot.mapper;

import com.cykj.v_m_sprintboot.bean.TbCommodity;
import com.cykj.v_m_sprintboot.bean.TbCommorityCategory;
import com.cykj.v_m_sprintboot.bean.TbVmi;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TbCommodityMapper {
    List<TbVmi> vmiInfo();
    void vmPay(@Param(value = "ComName")String ComName,@Param(value = "ComNum")String ComNum,
               @Param(value = "vmid")String vmid);//售货机购买
    int vmNum(@Param(value = "ComName")String ComName,@Param(value = "ComNum")String ComNum,
              @Param(value = "vmid")String vmid);//查询售货机商品数量
    int vmState(@Param(value = "ComName")String ComName,@Param(value = "ComNum")String ComNum,
                      @Param(value = "vmid")String vmid);//查询售货机商品数量状态
    void vmApply(@Param(value = "ComName")String ComName, @Param(value = "goodsType")String goodsType,
                 @Param(value = "goodsUnit")String goodsUnit,@Param(value = "categoryID")String categoryID,
                 @Param(value = "ComNum")String ComNum,@Param(value = "orderTime")String orderTime,
                 @Param(value = "vmid")String vmid);//根据售货机商品剩余数量自动申请补货
    void vmStateApply(@Param(value = "ComName")String ComName,@Param(value = "ComNum")String ComNum,
               @Param(value = "vmid")String vmid);//售货机商品数量状态改为申请补货中
    void vmStateNormal(@Param(value = "ComName")String ComName,@Param(value = "ComNum")String ComNum,
                      @Param(value = "vmid")String vmid);//售货机商品数量状态改为正常
    void vmFundComm(@Param(value = "comImage")String comImage, @Param(value = "conName")String conName,
                 @Param(value = "conNum")String conNum, @Param(value = "comPrice")String comPrice,
                 @Param(value = "tradeNo")String tradeNo);//根据售货机商品剩余数量自动申请补货
    void vmSup(@Param(value = "ComName")String ComName,@Param(value = "ComNum")String ComNum,
               @Param(value = "vmid")String vmid);//售货机补货
    //售货机付款后添加订单
    void vmOrder(@Param(value = "tradeNo")String tradeNo,@Param(value = "fundName")String fundName,
                 @Param(value = "fundTime")String fundTime,@Param(value = "fundState")String fundState,
                 @Param(value = "fundMoney")String fundMoney,@Param(value = "fundNum")String fundNum,
                 @Param(value = "payMethod")String payMethod, @Param(value = "VMID")String VMID,
                 @Param(value = "openID")String openID);
    void vmCapital(@Param(value = "fundMoney")String fundMoney,@Param(value = "VMID")String VMID);
    //查询商品总条数
    int selcommdity();
    //查询商品分页
    List<TbCommodity> selcommdityPage(@Param(value = "page") int page,
                                      @Param(value = "size") int size,
                                      @Param(value = "vmid") int vmid,
                                      @Param(value = "cateid") int cateid);
    //查询商品
    List<TbCommodity> selectCommList(@Param(value = "vmid") int vmid,@Param(value = "cateid") int cateid,@Param(value = "page1") int page1,@Param(value = "size1") int size1);
    //修改商品数量
    void updateCommodity(
            @Param(value = "comNum") int comNum
            ,@Param(value = "comId") int comId
            ,@Param(value = "comName") String comName
            ,@Param(value = "comPrice") String comPrice);
    //删除商品
    void delCommodity(@Param(value = "comId") int comId);
    //前端获取商品
    List<TbCommodity> selectCommListqD(@Param(value = "vmid") int vmid);
    //增加商品
    void insComm(@Param(value = "comImage") String comImage,
                 @Param(value = "comName") String comName,
                 @Param(value = "comPrice") String comPrice,
                 @Param(value = "cateid") int cateid,
                 @Param(value = "vmid") int vmid,
                 @Param(value = "comNum") int comNum);
}
